import FightAttri from './fightAttri';
import {
    totalConfig,
    propName
} from 'server/config/templateConfig';

let petsConfig = totalConfig.pet;


class PetModel {
    static getInstance() {
        if (!PetModel.instance) {
            PetModel.instance = new PetModel();
        }
        return PetModel.instance;
    }


    create(opts) {
        opts = opts || {};
        let templateId = opts.templateId;
        let petConfig = petsConfig[opts.templateId];
        let data = {
            name: opts.name || petConfig.name,
            fightAttri: FightAttri.create(petConfig.fightAttri)
        };
        data.fightAttri.name = data.name;
        return data;
    }
}

export default PetModel.getInstance();